package com.app.internationaltravel.dao;

import com.app.internationaltravel.entity.UserSign;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserSignDao extends BaseMapper<UserSign> {

  @Select("select * from t_user_sign where uid=#{uid} order by ctime desc limit 1")
  UserSign queryLast(int uid);

  @Select("select * from t_user_sign where uid=#{uid} and DATE_FORMAT(now(),'%Y-%m') = #{ctime}")
  List<UserSign> queryMonth(@Param("uid") int uid,@Param("ctime") String ctime);
}
